package com.jlpay.openapi.demo.openmerch.bill;

import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import main.java.com.jlpay.open.jlpay.sdk.java.model.openmerch.bill.request.SettleBillQueryRequest;
import main.java.com.jlpay.open.jlpay.sdk.java.model.openmerch.bill.response.SettleBillQueryResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liaochangyi
 * @date 2025-08-14  13:48
 */
public class SettleBillQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(OpenBillDownloadQueryService.class);

    public static void main(String[] args) {
        SettleBillQueryRequest request = buildSettleBillQueryRequest();
        SettleBillQueryResponse response = JlpayOpenApiService.openMerchService()
                .post(request, SettleBillQueryResponse.class);
        LOGGER.info("结算账单查询结果:{}", JsonUtils.toString(response));
    }

    private static SettleBillQueryRequest buildSettleBillQueryRequest() {
        SettleBillQueryRequest request = new SettleBillQueryRequest();
        request.setMerchNo("849584358120018");
        request.setStartBusiDate("2024-07-01");
        request.setEndBusiDate("2024-07-02");
        request.setStartSettleDate("2024-07-01");
        request.setEndSettleDate("2024-07-02");
        request.setPayStatus("1");
        return request;
    }
}
